import request from '@/utils/request';

// 查询产品列表
export const listProduce = (query: any) => {
  return request({
    url: '/project/produce/list',
    method: 'get',
    params: query
  });
}

// 查询产品列表
export const listProduceType = (query: any) => {
  return request({
    url: '/project/produce/listType',
    method: 'get',
    params: query
  });
}

// 查询产品详细
export const getProduce = (produceId: any) => {
  return request({
    url: `/project/produce/${produceId}`,
    method: 'get'
  });
}

// 新增产品
export const addProduce = (data: any) => {
  return request({
    url: '/project/produce',
    method: 'post',
    data: data
  });
}

// 新增产品类型
export const addProduceType = (data: any) => {
  return request({
    url: '/project/produce/addType',
    method: 'post',
    data: data
  });
}

// 修改产品
export const updateProduce = (data: any) => {
  return request({
    url: '/project/produce',
    method: 'put',
    data: data
  });
}

// 删除产品
export const delProduce = (produceId: any) => {
  return request({
    url: `/project/produce/${produceId}`,
    method: 'delete'
  });
}

// 查询产品类型下拉树结构
export const produceTypeTreeSelect = () => {
  return request({
    url: '/project/produce/produceTypeTree',
    method: 'get'
  });
}
